# This is a sample Python script.
class CONSTANT:
    TKINTER_INFO_USER_QQ_INPUT_EMPTY_RECORD = '未查询到QQ昵称对应的用户数据'
    TKINTER_INFO_USER_CHAT_INPUT_EMPTY_RECORD = '未查询到微信昵称对应的用户数据'
    TKINTER_LABEL_TIME = 'QQ 昵称'
    TKINTER_LABEL_CHAT = '微信昵称'
    TKINTER_NONE_CONTENT_TOAST = '根据用户昵称进行查询功能暂未开放，敬请期待'
    TKINTER_INFO_INPUT_CORRECT_EMPTY = '用户电话号码不能为空'
    INDEX_INFO_MESSAGE = 0
    TABLE_NAME_USER_ACCOUNT = 't_account_1'
    TABLE_NAME_ACCOUNT_INFO = 't_account_info_1'
    TABLE_NAME_USER_QQ = 't_user_qq_1'
    TABLE_NAME_USER_APP = 't_user_app_1'
    TABLE_NAME_USER_CHAT = 't_user_we_chat_1'
    TABLE_NAME_USER_APPLE = 't_user_apple_1'
    TABLE_NAME_USER_APPLE_BIND: str = 't_user_app_bind_1'
    TABLE_NAME_USER_ZHUSHOU_USER = 'app_user_1'
    PHONE_NUMBER_NOT_EXIST = 'AccountId已被删除或不存在'
    TKINTER_APPLICATION_TITLE_NAME = 'A刑事犯罪质量调查科清除账号GUI'
    TKINTER_LABEL_PHONE = '电话号码:'
    TKINTER_LABEL_NICKNAME = '唯一ID:'
    TKINTER_VARCHAR_INDEXNAME = 'index的练习'
    TKINTER_INFO_INPUT_CORRECT_VALUE = '请输入正确的值'
    TKINTER_INFO_USER_CHAT_INPUT_CORRECT_EMPTY = '微信昵称不能为空'
    TKINTER_CONTENT_TOAST = '''
    使用教程： 
    1. 目前"<查询>": 支持微信昵称、QQ昵称 
    2. 微信昵称和时间 支持<复合条件>查询
    3. 根据手机号删除同时会<查询>出<分库分表>的结果记录  
    4. \n微信、QQ昵称支持<模糊匹配>搜索，完整删除请尽量输入<完整>的昵称因为有可能昵称会对应多个微信账号\n，会一起被删除掉,如果没有把握、请 同时 输入 <时间和微信 > 昵称以确保唯一性
    5、唯一ID是根据表ID 指定删除记录并非UUID ,因为有些表记录UUID 为空，因此指定唯一ID进行删除
    '''
    TKINTER_CONFIRM_CLEAN = '清除'
    TKINTER_CONFIRM_SELECT = '查询'
    TKINTER_INFO_CONFIRM_CORRECT_VALUE = '老铁,你确定输的电话号码是正确且存在'
    TOAST_FOR_DELTE_INFORMATION = '删除成功'
    TOAST_FOR_DELTE_INFORMATION_RECORDER = '清除记录成功'


import mysql


class MysqlHelper:
    def __init__(self, host='sql-t01cn-rw.svc.53zaixian.com', user='app_test', passwd='quWxRxYv1GzB%1iy',
                 database='user_center_0'):
        self.conn = mysql.connector.connect(host=host, user=user, passwd=passwd, database=database, buffered=True)
        self.cursor = self.conn.cursor()

    def transactionCommit(self):
        self.conn.commit()

    def transactionClose(self):
        self.conn.close()

    def delUserInformation(self, tablename0, tablename1, accountId=0):
        self.cursor.execute(
            "delete  from %s  where uuid=%s" % (tablename0, accountId))
        self.cursor.execute(
            "delete  from %s  where uuid=%s" % (tablename1, accountId))

    def delUserAccount(self, tablename0, tablename1, accountId=0):
        self.cursor.execute(
            "delete  from %s  where id=%s" % (tablename0, accountId))
        self.cursor.execute(
            "delete  from %s  where id=%s" % (tablename1, accountId))

        # account_id = self.cursor.fetchone().__getitem__(CONSTANT.INDEX_INFO_MESSAGE)[0]

    def getAccountId(self, start_account0_tablename, start_account0_tablename_phone):
        self.cursor.execute(
            "select * from %s  where phone=%s" % (start_account0_tablename, start_account0_tablename_phone))
        # account_id = self.cursor.fetchone().__getitem__(CONSTANT.INDEX_INFO_MESSAGE)[0]
        account_id = self.cursor.fetchone()
        if not account_id:
            self.cursor.execute(
                "select * from %s  where phone=%s" % (CONSTANT.TABLE_NAME_USER_ACCOUNT, start_account0_tablename_phone))
            account_id = self.cursor.fetchone()
            if not account_id:
                return None
            return account_id[CONSTANT.INDEX_INFO_MESSAGE]

        return account_id[CONSTANT.INDEX_INFO_MESSAGE]

    def getAccountIdReplica(self, start_account0_tablename, start_account0_tablename_phone):
        self.cursor.execute(
            "select * from %s  where phone=%s" % (start_account0_tablename, start_account0_tablename_phone))
        # account_id = self.cursor.fetchone().__getitem__(CONSTANT.INDEX_INFO_MESSAGE)[0]
        account_id = self.cursor.fetchone()
        if not account_id:
            self.cursor.execute(
                "select * from %s  where phone=%s" % (CONSTANT.TABLE_NAME_USER_ACCOUNT, start_account0_tablename_phone))
            account_id = self.cursor.fetchone()
            if not account_id:
                return None
            return account_id[CONSTANT.INDEX_INFO_MESSAGE]

        return account_id[CONSTANT.INDEX_INFO_MESSAGE]

    def getAccountInfo(self, start_accountInfo0_tablename, account_id):
        self.cursor.execute("select * from %s  where uuid=%s" % (start_accountInfo0_tablename, account_id))
        record_account_info = self.cursor.fetchone()
        if not record_account_info:
            self.cursor.execute(
                "select * from %s  where uuid=%s" % (CONSTANT.TABLE_NAME_ACCOUNT_INFO, account_id))
            record_account_info = self.cursor.fetchone()
        return record_account_info

    def getUserApp(self, start_userapp0_tablename, account_id):
        self.cursor.execute("select * from %s  where uuid=%s" % (start_userapp0_tablename, account_id))
        record_user_app = self.cursor.fetchone()
        if not record_user_app:
            self.cursor.execute(
                "select * from %s  where uuid=%s" % (CONSTANT.TABLE_NAME_USER_APP, account_id))
            record_user_app = self.cursor.fetchone()
        return record_user_app

    def getUserQQ(self, start_useqq0_tablename, account_id):
        self.cursor.execute("select * from %s  where uuid=%s" % (start_useqq0_tablename, account_id))
        record_user_qq = self.cursor.fetchone()
        if not record_user_qq:
            self.cursor.execute(
                "select * from %s  where uuid=%s" % (CONSTANT.TABLE_NAME_USER_QQ, account_id))
            record_user_qq = self.cursor.fetchone()
        return record_user_qq

    def getUserChat(self, start_usechat0_tablename, account_id):
        self.cursor.execute(
            "select * from %s  where uuid=%s" % (start_usechat0_tablename, account_id))
        record_user_chat = self.cursor.fetchone()
        if not record_user_chat:
            self.cursor.execute(
                "select * from %s  where uuid=%s" % (CONSTANT.TABLE_NAME_USER_CHAT, account_id))
            record_user_chat = self.cursor.fetchone()
        return record_user_chat

    def getUserChatInNickName(self, start_usechat0_tablename, wechat):
        arrayList = []
        # sql = "SELECT * FROM T_SECTION WHERE TITLE LIKE '%s'" % ('%%%s%%' % sel)
        self.cursor.execute(
            "select * from %s  where nick_name  like '%%%s%%'" % (start_usechat0_tablename, wechat))
        record_user_chat_1 = self.cursor.fetchall()
        if record_user_chat_1:
            self.addArrayListFORuserChat(arrayList, record_user_chat_1)
            self.cursor.execute(
                "select * from %s  where nick_name like '%%%s%%'" % (CONSTANT.TABLE_NAME_USER_CHAT, wechat))
            record_user_chat_beta = self.cursor.fetchall()
            if record_user_chat_beta:
                self.addArrayListFORuserChat(arrayList, record_user_chat_beta)
        if not record_user_chat_1:
            self.cursor.execute(
                "select * from %s  where nick_name like '%%%s%%'" % (CONSTANT.TABLE_NAME_USER_CHAT, wechat))
            record_user_chat = self.cursor.fetchall()
            if record_user_chat:
                self.addArrayListFORuserChat(arrayList, record_user_chat)
        return arrayList

    def addArrayListFORuserChat(self, arrayList, record_user_chat_1):
        arrayList.append(record_user_chat_1)
        arrayList.append('*' * 10)

    def getUserQQInNickName(self, tablename_qq_0, qq):
        arrayList_qq = []
        # sql = "SELECT * FROM T_SECTION WHERE TITLE LIKE '%s'" % ('%%%s%%' % sel)
        self.cursor.execute(
            "select * from %s  where nick_name  like '%%%s%%'" % (tablename_qq_0, qq))
        record_user_chat_1 = self.cursor.fetchall()
        if record_user_chat_1:
            self.addArrayListFORuserChat(arrayList_qq, record_user_chat_1)
            self.cursor.execute(
                "select * from %s  where nick_name like '%%%s%%'" % (CONSTANT.TABLE_NAME_USER_QQ, qq))
            record_user_chat_beta = self.cursor.fetchall()
            if record_user_chat_beta:
                self.addArrayListFORuserChat(arrayList_qq, record_user_chat_beta)
        if not record_user_chat_1:
            self.cursor.execute(
                "select * from %s  where nick_name like '%%%s%%'" % (CONSTANT.TABLE_NAME_USER_QQ, qq))
            record_user_chat = self.cursor.fetchall()
            if record_user_chat:
                self.addArrayListFORuserChat(arrayList_qq, record_user_chat)
        return arrayList_qq

    def getUserApple(self, start_useApple0_tablename, account_id):
        self.cursor.execute(
            "select * from %s  where uuid=%s" % (start_useApple0_tablename, account_id))
        record_user_apple = self.cursor.fetchone()
        if not record_user_apple:
            self.cursor.execute(
                "select * from %s  where uuid=%s" % (CONSTANT.TABLE_NAME_USER_APPLE, account_id))
            record_user_apple = self.cursor.fetchone()
        return record_user_apple

    def getUserAppleBind(self, start_useAppleBind0_tablename, account_id):
        self.cursor.execute(
            "select * from %s  where uuid=%s" % (start_useAppleBind0_tablename, account_id))
        record_user_apple_bind = self.cursor.fetchone()
        if not record_user_apple_bind:
            self.cursor.execute(
                "select * from %s  where uuid=%s" % (CONSTANT.TABLE_NAME_USER_APPLE_BIND, account_id))
            record_user_apple_bind = self.cursor.fetchall()
        return record_user_apple_bind

    def getZhushouUser(self, start_usezhushou_tablename, account_id):
        self.cursor.execute(
            "select * from %s  where uuid=%s" % (start_usezhushou_tablename, account_id))
        record_user_zhushou_user = self.cursor.fetchone()
        if not record_user_zhushou_user:
            self.cursor.execute(
                "select * from %s  where uuid=%s" % (CONSTANT.TABLE_NAME_USER_ZHUSHOU_USER, account_id))
            record_user_zhushou_user = self.cursor.fetchone()
        return record_user_zhushou_user

    def delUserInformationByID(self, main_table, minor_table, user_uuid):
        self.cursor.execute(
            "delete  from %s  where id=%s" % (main_table, user_uuid))
        self.cursor.execute(
            "delete  from %s  where id=%s" % (minor_table, user_uuid))

        pass


class MysqlHelperReplica(MysqlHelper):
    def __init__(self, host, user, passwd, database):
        # MysqlHelper.__init__(self, host, user, passwd, database)
        super(MysqlHelperReplica, self).__init__(host, user, passwd, database)


# Press the green button in the gutter to run the script.

class Business:
    def __init__(self, phone=None, wechat=None, qq=None):
        self.phone = phone
        self.qq = qq
        self.wechat = wechat
        self.mysqlHelper, self.mysqlHelperReplica, self.mysqlHelperZhushou, self.mysqlHelperZhushouReplica, self.tablename_account_0, self.tablename_wechat_0, self.tablename_qq_0 = self.getDBConnection()
        pass

    # TODO
    def getWeChatBusiness(self):
        record_user_chat_list = []
        record_user_chat_main = self.mysqlHelper.getUserChatInNickName(self.tablename_wechat_0, self.wechat)
        # todo
        # self.mysqlHelper.delUserInformation(self.tablename_wechat_0, CONSTANT.TABLE_NAME_USER_CHAT, self.wechat)
        if record_user_chat_main:
            self.appendRecordUserChatList(record_user_chat_main, record_user_chat_list)
            self.whetherRecordUserChatorNot(record_user_chat_main, record_user_chat_list)
        if not record_user_chat_main:
            self.whetherRecordUserChatorNot(record_user_chat=None, record_user_chat_list=record_user_chat_list)

        # self.mysqlHelperReplica.delUserInformation(self.tablename_wechat_0, CONSTANT.TABLE_NAME_USER_CHAT, self.wechat)
        print("record_user_chat_list=", record_user_chat_list)

        return record_user_chat_list

        self.padlockDBconn(self.mysqlHelper, self.mysqlHelperReplica, self.mysqlHelperZhushou,
                           self.mysqlHelperZhushouReplica)

    def getQQBusiness(self):
        record_user_qq_list = []
        record_user_chat_main = self.mysqlHelper.getUserQQInNickName(self.tablename_qq_0, self.qq)
        # todo
        # self.mysqlHelper.delUserInformation(self.tablename_wechat_0, CONSTANT.TABLE_NAME_USER_CHAT, self.wechat)
        if record_user_chat_main:
            self.appendRecordUserChatList(record_user_chat_main, record_user_qq_list)
            self.whetherRecordUserQQorNot(record_user_chat_main, record_user_qq_list)
        if not record_user_chat_main:
            self.whetherRecordUserQQorNot(record_user_chat=None, record_user_chat_list=record_user_qq_list)

        # self.mysqlHelperReplica.delUserInformation(self.tablename_wechat_0, CONSTANT.TABLE_NAME_USER_CHAT, self.wechat)
        print("record_user_chat_list=", record_user_qq_list)

        return record_user_qq_list

        self.padlockDBconn(self.mysqlHelper, self.mysqlHelperReplica, self.mysqlHelperZhushou,
                           self.mysqlHelperZhushouReplica)

    def whetherRecordUserChatorNot(self, record_user_chat, record_user_chat_list):
        record_user_chat_2 = self.mysqlHelperReplica.getUserChatInNickName(self.tablename_wechat_0, self.wechat)
        if record_user_chat_2:
            self.appendRecordUserChatList(record_user_chat_2, record_user_chat_list)

    def whetherRecordUserQQorNot(self, record_user_chat, record_user_chat_list):
        record_user_chat_2 = self.mysqlHelperReplica.getUserQQInNickName(self.tablename_qq_0, self.qq)
        if record_user_chat_2:
            self.appendRecordUserChatList(record_user_chat_2, record_user_chat_list)

    def appendRecordUserChatList(self, record_user_chat, record_user_chat_list):
        record_user_chat_list.append(record_user_chat)
        record_user_chat_list.append('*' * 10)

    def getAccountBusiness(self):

        account_id = self.mysqlHelper.getAccountId(self.tablename_account_0, self.phone)

        if not account_id:
            account_id = self.mysqlHelperReplica.getAccountIdReplica(self.tablename_account_0, self.phone)
            if not account_id:
                return CONSTANT.PHONE_NUMBER_NOT_EXIST

        print("account_id222=", account_id)
        # if account_id == CONSTANT.PHONE_NUMBER_NOT_EXIST:
        #     return CONSTANT.PHONE_NUMBER_NOT_EXIST
        '''
        description:  删除账号关联的微信、QQ、 appleId
        '''
        account_ids = account_id
        concract_info = self.getBusinessDelete(self.mysqlHelper, self.mysqlHelperReplica, self.mysqlHelperZhushou,
                                               self.mysqlHelperZhushouReplica,
                                               account_id)
        '''
        description:  统一删除账号
        '''
        self.mysqlHelper.delUserAccount(self.tablename_account_0, CONSTANT.TABLE_NAME_USER_ACCOUNT, account_id)
        self.mysqlHelperReplica.delUserAccount(self.tablename_account_0, CONSTANT.TABLE_NAME_USER_ACCOUNT, account_id)
        print("account_id=", account_id)

        self.padlockDBconn(self.mysqlHelper, self.mysqlHelperReplica, self.mysqlHelperZhushou,
                           self.mysqlHelperZhushouReplica)
        return CONSTANT.TOAST_FOR_DELTE_INFORMATION_RECORDER + '\n' + str(concract_info)

    def padlockDBconn(self, mysqlHelper, mysqlHelperReplica, mysqlHelperZhushou, mysqlHelperZhushouReplica):
        '''
            desctoption: 提交事务删除
            '''
        mysqlHelper.transactionCommit()
        mysqlHelperReplica.transactionCommit()
        mysqlHelperZhushou.transactionCommit()
        mysqlHelperZhushouReplica.transactionCommit()
        '''
            desctoption: 关闭业务流
            '''
        mysqlHelper.transactionClose()
        mysqlHelperReplica.transactionClose()
        mysqlHelperZhushou.transactionClose()
        mysqlHelperZhushouReplica.transactionClose()

    def getDBConnection(self):
        global flag
        flag = False
        self.tablename_qq_0 = 't_user_qq_0'
        self.tablename_account_0 = 't_account_0'
        self.tablename_wechat_0 = 't_user_we_chat_0'
        mysql_master = {
            'host': "sql-t01cn-rw.svc.53zaixian.com",
            'user': "app_test",
            'passwd': "quWxRxYv1GzB%1iy",
            'database': "user_center_0"
        }
        mysql_replicas = {
            'host': "sql-t01cn-rw.svc.53zaixian.com",
            'user': "app_test",
            'passwd': "quWxRxYv1GzB%1iy",
            'database': "user_center_1"
        }
        mysql_master_zhushou = {
            'host': "sql-t01cn-rw.svc.53zaixian.com",
            'user': "app_test",
            'passwd': "quWxRxYv1GzB%1iy",
            'database': "zhushou_user_0"
        }
        mysql_replicas_zhushou = {
            'host': "sql-t01cn-rw.svc.53zaixian.com",
            'user': "app_test",
            'passwd': "quWxRxYv1GzB%1iy",
            'database': "zhushou_user_1"
        }
        self.mysqlHelper = MysqlHelper()
        self.mysqlHelperReplica = MysqlHelperReplica(**mysql_replicas)
        ##############  zhushou_user
        self.mysqlHelperZhushou = MysqlHelperReplica(**mysql_master_zhushou)
        self.mysqlHelperZhushouReplica = MysqlHelperReplica(**mysql_replicas_zhushou)
        return self.mysqlHelper, self.mysqlHelperReplica, self.mysqlHelperZhushou, self.mysqlHelperZhushouReplica, self.tablename_account_0, self.tablename_wechat_0, self.tablename_qq_0

    def getBusinessDelete(self, mysqlHelper, mysqlHelperReplica, mysqlHelperZhushou, mysqlHelperZhushouReplica,
                          account_id):
        '''
         t_account_info_0  DELETE  ;
        '''
        record_account_info = mysqlHelper.getAccountInfo('t_account_info_0', account_id)
        mysqlHelper.delUserInformation('t_account_info_0', CONSTANT.TABLE_NAME_ACCOUNT_INFO, account_id)
        if not record_account_info:
            record_account_info = mysqlHelperReplica.getAccountInfo('t_account_info_0', account_id)
        print("record_account_info=", record_account_info)
        mysqlHelperReplica.delUserInformation('t_account_info_0', CONSTANT.TABLE_NAME_ACCOUNT_INFO, account_id)
        print("record_account_info=", record_account_info)

        '''
        t_user_app_0  DELETE  ;
        '''
        record_user_app = mysqlHelper.getUserApp('t_user_app_0', account_id)
        mysqlHelper.delUserInformation('t_user_app_0', CONSTANT.TABLE_NAME_USER_APP, account_id)
        if not record_user_app:
            record_user_app = mysqlHelperReplica.getUserApp('t_user_app_0', account_id)
        print("record_user_app=", record_user_app)
        mysqlHelperReplica.delUserInformation('t_user_app_0', CONSTANT.TABLE_NAME_USER_APP, account_id)
        print("record_user_app=", record_user_app)
        '''
        t_user_qq_0
        :param mysqlHelper:   mysql.mysqlHelper for main object
        :param mysqlHelperReplica:   mysql.mysqlHelperReplica for database source in inner obj
        :param account_id:  for subsidiary object to  search other
        :return: inner object
        '''
        record_user_qq = mysqlHelper.getUserQQ('t_user_qq_0', account_id)
        mysqlHelper.delUserInformation('t_user_qq_0', CONSTANT.TABLE_NAME_USER_QQ, account_id)
        if not record_user_qq:
            record_user_qq = mysqlHelperReplica.getUserQQ('t_user_qq_0', account_id)
        print("record_user_qq=", record_user_qq)
        mysqlHelperReplica.delUserInformation('t_user_qq_0', CONSTANT.TABLE_NAME_USER_QQ, account_id)
        print("record_user_qq=", record_user_qq)

        '''
        t_user_we_chat_0  DELETE  ; 1347061921255206914
        '''
        record_user_chat = mysqlHelper.getUserChat('t_user_we_chat_0', account_id)
        # todo
        mysqlHelper.delUserInformation('t_user_we_chat_0', CONSTANT.TABLE_NAME_USER_CHAT, account_id)
        if not record_user_chat:
            record_user_chat = mysqlHelperReplica.getUserChat('t_user_we_chat_0', account_id)
        print("record_user_chat=", record_user_chat)
        mysqlHelperReplica.delUserInformation('t_user_we_chat_0', CONSTANT.TABLE_NAME_USER_CHAT, account_id)
        print("record_user_chat=", record_user_chat)
        '''
        t_user_apple_0 DELETE ;
        '''
        record_user_apple = mysqlHelper.getUserApple('t_user_apple_0', account_id)
        mysqlHelper.delUserInformation('t_user_apple_0', CONSTANT.TABLE_NAME_USER_APPLE, account_id)
        if not record_user_apple:
            record_user_apple = mysqlHelperReplica.getUserApple('t_user_apple_0', account_id)
        print("record_user_apple = ", record_user_apple)
        mysqlHelperReplica.delUserInformation('t_user_apple_0', CONSTANT.TABLE_NAME_USER_APPLE, account_id)
        print("record_user_apple = ", record_user_apple)

        '''
        t_user_app_bind_0 DELETE ;
        '''
        record_user_apple_bind = mysqlHelper.getUserAppleBind('t_user_app_bind_0', account_id)
        mysqlHelper.delUserInformation('t_user_app_bind_0', CONSTANT.TABLE_NAME_USER_APPLE_BIND, account_id)
        if not record_user_apple_bind:
            record_user_apple_bind = mysqlHelperReplica.getUserAppleBind('t_user_app_bind_0', account_id)
        print("record_user_apple_bind =", record_user_apple_bind)
        mysqlHelperReplica.delUserInformation('t_user_app_bind_0', CONSTANT.TABLE_NAME_USER_APPLE_BIND, account_id)
        print("record_user_apple_bind =", record_user_apple_bind)
        '''
        app_user_0 DELETE ;
        '''
        record_user_zhushou_user = mysqlHelperZhushou.getZhushouUser('app_user_0', account_id)
        mysqlHelperZhushou.delUserInformation('app_user_0', CONSTANT.TABLE_NAME_USER_ZHUSHOU_USER, account_id)
        if not record_user_zhushou_user:
            record_user_zhushou_user = mysqlHelperZhushouReplica.getZhushouUser('app_user_0', account_id)
        print("record_user_zhushou_user =", record_user_zhushou_user)
        mysqlHelperZhushouReplica.delUserInformation('app_user_0', CONSTANT.TABLE_NAME_USER_ZHUSHOU_USER, account_id)
        print("record_user_zhushou_user =", record_user_zhushou_user)

        str_record_account_info, str_record_user_app, str_record_user_apple, str_record_user_apple_bind, str_record_user_chat, str_record_user_qq, str_record_user_zhushou_user = self.userRecordInformation(
            record_account_info, record_user_app, record_user_apple, record_user_apple_bind, record_user_chat,
            record_user_qq, record_user_zhushou_user)
        str_record_concrate = "str_record_account_info=" + str_record_account_info + "str_record_user_app=" + str_record_user_app + "str_record_user_qq=" + str_record_user_qq + "str_record_user_chat=" + str_record_user_chat + "str_record_user_apple=" + str_record_user_apple + "str_record_user_apple_bind=" + str_record_user_apple_bind + "str_record_user_zhushou_user=" + str_record_user_zhushou_user

        return str_record_concrate  # CONSTANT.TOAST_FOR_DELTE_INFORMATION

    def userRecordInformation(self, record_account_info, record_user_app, record_user_apple, record_user_apple_bind,
                              record_user_chat, record_user_qq, record_user_zhushou_user):
        str_record_account_info = str(record_account_info) + '\n'
        str_record_user_app = str(record_user_app) + '\n'
        str_record_user_qq = str(record_user_qq) + '\n'
        str_record_user_chat = str(record_user_chat) + '\n'
        str_record_user_apple = str(record_user_apple) + '\n'
        str_record_user_apple_bind = str(record_user_apple_bind) + '\n'
        str_record_user_zhushou_user = str(record_user_zhushou_user) + '\n'
        return str_record_account_info, str_record_user_app, str_record_user_apple, str_record_user_apple_bind, str_record_user_chat, str_record_user_qq, str_record_user_zhushou_user

    def delBusinessByID(self, user_uuid):
        '''
        description: delete infomation by user_id
        :param user_uuid:   指定QQ号码、微信昵称对应的ID
        :return:   None
        '''
        self.mysqlHelper.delUserInformationByID('t_user_qq_0', CONSTANT.TABLE_NAME_USER_QQ, user_uuid)
        self.mysqlHelperReplica.delUserInformationByID('t_user_qq_0', CONSTANT.TABLE_NAME_USER_QQ, user_uuid)

        self.mysqlHelper.delUserInformationByID('t_user_we_chat_0', CONSTANT.TABLE_NAME_USER_CHAT, user_uuid)
        self.mysqlHelperReplica.delUserInformationByID('t_user_we_chat_0', CONSTANT.TABLE_NAME_USER_CHAT, user_uuid)

        self.padlockDBconn(self.mysqlHelper, self.mysqlHelperReplica, self.mysqlHelperZhushou,
                           self.mysqlHelperZhushouReplica)

        pass


if __name__ == '__main__':
    number1 = 18515461863
    number2 = 18515461863
    phone = None
   #phone = '16601113279'
    #phone = 18322717942
    print("Business(15811191880).getAccountBusiness()===>" + Business(18322717941).getAccountBusiness())

########master


# See PyCharm help at https://www.jetbrains.com/help/pycharm/
